# coding=utf-8
from phosphorusScripts.bedcore.client import clientApi, viewBinder, viewRequest
from phosphorusScripts.modInfo import ModInfo


class PauseScreenProxy(clientApi.GetUIScreenProxyCls()):

    def __init__(self, screenName, screenNode):
        super(PauseScreenProxy, self).__init__(screenName, screenNode)
        self.client = clientApi.GetSystem(ModInfo.NAME, 'main')

    @viewBinder.binding(viewBinder.BF_InteractButtonClick, 'button.phosphorus.open_screen')
    def handleOpenScreenButton(self, args):
        self.client.NotifyToServer('OpenScreenRequestEvent', {})
        return viewRequest.Refresh
